
*************************************************************************************************
*** This do file re-creates the regressions and figures for 
*** Trust and Support for Comprehensive Trade Agreements in the European Parliament
*** SARA NORREVIK, University at Buffalo
*** Contact: saramati@buffalo.edu
**************************************************************************************************
*** Published in International Studies Quarterly
**************************************************************************************************


***********************************************   T A B L E S  ***************************************************************************

***EP Voting Analyses***

**Table 1 Models: Multilevel model with government trust as predictor for trade vote. Estimate Intraclass correlation (ICC)**

use "/Users/macuser/Documents/Norrevik ISQ Datafile Trust.dta", replace

meqrlogit Vote trustgov agri manufactprod hitechmanufactempl green negimm loggdp unempl educ left gender highlevelMEP || CountryNo: left gender highlevelMEP
estat icc 

meqrlogit Vote trustgov agri manufactprod manufactempl green negimm loggdp unempl educ left || CountryNo: left 

meqrlogit Vote trustgov agri manufactprod hitechmanufactempl green negimm loggdp unempl educ left || CountryNo: left if east==0

meqrlogit Vote trusteu agri manufactprod hitechmanufactempl green negimm loggdp unempl educ left || CountryNo: left


***********************************************   F I G U R E S  ***************************************************************************


*** Figure 1: MEPs mean support for trade and trust in government ***

twoway (scatter Votemean trustgov), ytitle(MEPs' mean support for trade) xtitle(Trust in government) || lfit Votemean trustgov


*** Figure 2: Predicted values and plot the estimated regression line for each country ***

meqrlogit Vote trustgov agri manufactprod hitechmanufactempl green negimm loggdp unempl educ left gender highlevelMEP || CountryNo: left gender highlevelMEP

predict vote_hat

margins, at( trustgov =(10(10)60)) atmeans predict(mu fixedonly)

marginsplot, scheme(s1mono)  ytitle(Predicted Probabilities in Voting in Favor of CTA) xtitle(Trust in Government)


***Figure 3: Anscombe plot for goodness of fit measures: Comparing left-wing MEPs and right-wing MEPs***

predict anscombe, anscombe fixedonly

twoway (scatter anscombe trustgov if left, msymbol(S)) (scatter anscombe trustgov if !left, msymbol (T)), yline(-2  2)  legend(label(1 "Left leaning MEPs") label(2 "Right leaning MEPs"))

*Additional Anscombe test: Comparing Eastern European MEPs and Western European MEPs* 

twoway (scatter anscombe trustgov if east, msymbol(S)) (scatter anscombe trustgov if !east, msymbol (T)), yline(-2  2)  legend(label(1 "East") label(2 "West"))


******************************************   ONLINE APPENDIX MODELS  *********************************************************************

***Summary statistics***

sum Vote, detail
sum trustgov, detail
sum trusteu, detail
sum agri, detail
sum manufactprod, detail
sum hitechmanufactempl, detail
sum manufactempl, detail
sum green, detail
sum negimm, detail
sum loggdp, detail
sum unempl, detail
sum educ, detail
sum left, detail
sum gender, detail
sum highlevelMEP, detail
sum govparty, detail


***Goodness of fit measures: Anscombe and Deviance residuals***

***Table 2.a: Anscombe residuals***

predict anscombe, anscombe fixedonly

sum anscombe, detail


***Table 2.b: Deviance residuals***

predict d, deviance

sum d, detail


***Models used in Table 3 in Appendix: Robustness tests with EP-party group controls for far-right parties combined, S&D, EPP, ALDE***

meqrlogit Vote trustgov agri manufactprod hitechmanufactempl green negimm loggdp loggdp farright || CountryNo: farright

meqrlogit Vote trustgov agri manufactprod hitechmanufactempl green negimm loggdp educ sd || CountryNo: sd

meqrlogit Vote trustgov agri manufactprod hitechmanufactempl green negimm loggdp educ epp || CountryNo: epp

meqrlogit Vote trustgov agri manufactprod hitechmanufactempl green negimm loggdp educ alde || CountryNo: alde


***Table 4, Model 1-2: Robustness tests controlling for national government/opposition status, first omitting govparty for comparison***

meqrlogit Vote trustgov agri manufactprod hitechmanufactempl green negimm loggdp unempl educ left || CountryNo: left 

meqrlogit Vote trustgov agri manufactprod hitechmanufactempl green negimm loggdp unempl educ left govparty|| CountryNo: left govparty


***Table 4, Model 3: Robustness test without the UK***

meqrlogit Vote trustgov agri manufactprod hitechmanufactempl green negimm loggdp unempl educ left|| CountryNo: left if CountryNo!=28


***Table 5, Model 1: Robustness tests controlling for CTAs (dummies)***

meqrlogit Vote trustgov agri manufactprod hitechmanufactempl green negimm loggdp unempl educ left ttip ceta eusk || CountryNo: left 


***Table 5, Models 2-4: Robustness tests testing each CTA separately***

meqrlogit Vote trustgov agri manufactprod hitechmanufactempl green negimm left || CountryNo: left if ttip==1

meqrlogit Vote trustgov agri manufactprod hitechmanufactempl green negimm left || CountryNo: left if ceta==1

meqrlogit Vote trustgov agri manufactprod hitechmanufactempl green negimm left || CountryNo: left if eusk==1


***Additional robustness tests estimated, not reported in the Appendix***

***EP-party group controls and trust in the EU***

meqrlogit Vote trusteu agri manufactprod hitechmanufactempl green negimm loggdp educ farright || CountryNo: farright

meqrlogit Vote trusteu agri manufactprod hitechmanufactempl green negimm loggdp educ sd || CountryNo: sd

meqrlogit Vote trusteu agri manufactprod hitechmanufactempl green negimm loggdp educ epp || CountryNo: epp

meqrlogit Vote trusteu agri manufactprod hitechmanufactempl green negimm loggdp educ alde || CountryNo: alde




